home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- * MNUBAR.C - The mnu_bar(), mnu_enable(), and mnu_disable() functions.
- *************************************************************************/
-
- #include "gemfintl.h"
- #undef menu_bar
-
- static void *lastmenu;
- static short hidecount;
-
- short mnu_bar(menutree, flag, reserved)
- OBJECT *menutree;
- short flag;
- long reserved;
- {
- (void)reserved;
- lastmenu = (flag) ? menutree : NULL;
- hidecount = 0;
- return menu_bar(menutree, flag);
- }
-
- void mnu_disable()
- {
- if (lastmenu != NULL) {
- if (++hidecount == 1) {
- menu_bar(lastmenu, 0);
- }
- }
- }
-
- void mnu_enable()
- {
- if (lastmenu != NULL) {
- if (--hidecount <= 0) {
- hidecount = 0;
- menu_bar(lastmenu, 1);
- }
- }
- }
-
-